package com.neepu.pojo;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.web.multipart.MultipartFile;

public class Document {

	private Integer id;
	private String filename;
	private MultipartFile file;

	//关于时间的格式转换
	private Date createdate;
	private String creatTimeStr;
	private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getFilename() {
		return filename;
	}
	public void setFilename(String filename) {
		this.filename = filename;
	}
	public MultipartFile getFile() {
		return file;
	}
	public void setFile(MultipartFile file) {
		this.file = file;
	}
	public Date getCreatedate() {
		return createdate;
	}
	public void setCreatedate(Date createdate) {
		this.createdate = createdate;
        String time = sdf.format(createdate);
        setCreatTimeStr(time);
	}
	public String getCreatTimeStr() {
		return creatTimeStr;
	}
	public void setCreatTimeStr(String creatTimeStr) {
		this.creatTimeStr = creatTimeStr;
	}
	public SimpleDateFormat getSdf() {
		return sdf;
	}
	public void setSdf(SimpleDateFormat sdf) {
		this.sdf = sdf;
	}

	@Override
	public String toString() {
		return "Document{" +
				"id=" + id +
				", filename='" + filename + '\'' +
				", file=" + file +
				", createdate=" + createdate +
				", creatTimeStr='" + creatTimeStr + '\'' +
				", sdf=" + sdf +
				'}';
	}
}
